package biz.ezcom.s2sh.action.user;

import java.util.List;
import java.util.Map;

import biz.ezcom.s2sh.pojo.User;
import biz.ezcom.s2sh.service.UserService;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ListUserAction extends ActionSupport{
	private UserService userService;
	
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		List<User> userList = userService.findAllUsers();
		Map<String, Object> request = (Map<String, Object>) ActionContext.getContext().get("request");
		request.put("list", userList);
		return SUCCESS;
	}
}
